package com.richapp.launcher.net.camera;

import android.content.Context;

import com.jack.netty.udp.server.UdpServer;

/**
 * Created by jack on 16/3/4.
 */
public class AnyanUdpServer extends UdpServer {

    private static AnyanUdpServer anyanUdpServer = null;
    public static final int PORT_ANYAN_UDP_SEND = 2323;
    private Context context;

    private AnyanUdpServer(){

    }

    public static AnyanUdpServer getInstance(){
        if(anyanUdpServer == null){
            synchronized (AnyanUdpServer.class){
                if(anyanUdpServer == null){
                    anyanUdpServer = new AnyanUdpServer();
                    anyanUdpServer.setPort(PORT_ANYAN_UDP_SEND);
                    anyanUdpServer.setUdpServerListener(new AnyanCameraUdpListener());
                }
            }
        }
        return anyanUdpServer;
    }

    public Context getContext() {
        return context;
    }

    public void setContext(Context context) {
        this.context = context;
    }
}
